package cn.yeamin.ms.config;

import com.jagregory.shiro.freemarker.ShiroTags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

import javax.annotation.PostConstruct;

/**
 * @packageName: 包名: cn.yeamin.ms.config
 * @classDesc: 类功能描述:(FreeMarker扩展配置:添加Shiro标签库)
 * @author: Administrator
 * @createTime: 2017/7/26 15:19
 * @version: v1.0
 * @copyright:奕明(上海)影视传媒有限公司
 */
@Configuration
public class FreeMarkerConfig {

    @Autowired
    private freemarker.template.Configuration configuration;

    @PostConstruct
    public void setSharedVariable() {
        try {
            configuration.setSharedVariable("shiro", new ShiroTags());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
